<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Pisces","version":"7.7.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="jQuery">
<meta property="og:type" content="article">
<meta property="og:title" content="Java日拱一卒-day17">
<meta property="og:url" content="http://yoursite.com/2020/05/15/Java%E6%97%A5%E6%8B%B1%E4%B8%80%E5%8D%92-day17/index.html">
<meta property="og:site_name" content="很惭愧，就做了一点微小的工作">
<meta property="og:description" content="jQuery">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-05-15T15:37:19.000Z">
<meta property="article:modified_time" content="2020-05-16T08:39:23.370Z">
<meta property="article:author" content="文予">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/05/15/Java%E6%97%A5%E6%8B%B1%E4%B8%80%E5%8D%92-day17/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Java日拱一卒-day17 | 很惭愧，就做了一点微小的工作</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">很惭愧，就做了一点微小的工作</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">念念不忘，必有回响</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/05/15/Java%E6%97%A5%E6%8B%B1%E4%B8%80%E5%8D%92-day17/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/uploads/wenyu.png">
      <meta itemprop="name" content="文予">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="很惭愧，就做了一点微小的工作">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Java日拱一卒-day17
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-05-15 23:37:19" itemprop="dateCreated datePublished" datetime="2020-05-15T23:37:19+08:00">2020-05-15</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-05-16 16:39:23" itemprop="dateModified" datetime="2020-05-16T16:39:23+08:00">2020-05-16</time>
              </span>

          
            <div class="post-description">jQuery</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p><code>jQuery</code>是一门轻量的、免费的、开源的JavaScript函数库（就是js的简单框架），可以极大的简化js代码</p>
<p><code>jQuery</code>本质是一个包含了很多函数的js的文件，如果要在某一个HTML页面中使用中js文件中的函数，就必须将js文件引入到HTML中</p>
<h2 id="jQuery引入"><a href="#jQuery引入" class="headerlink" title="jQuery引入"></a><code>jQuery</code>引入</h2><p><code>jQuery</code>的函数库文件是一个普通的js文件，引入方法与引入js文件一样</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"js/jquery-1.8.3.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure>

<h2 id="jQuery语法"><a href="#jQuery语法" class="headerlink" title="jQuery语法"></a><code>jQuery</code>语法</h2><p><code>jQuery</code>语法是选取HTML元素，并对选取的元素执行某些操作。基础语法为</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$(selector).action()</span><br></pre></td></tr></table></figure>

<ul>
<li><code>$</code>定义<code>jQuery</code></li>
<li>选择符<code>selector</code>查询和查找HTML元素</li>
<li><code>action()</code>执行对元素的操作</li>
</ul>
<p>例如：</p>
<ul>
<li><code>$(this).hide()</code>：隐藏当前元素</li>
<li><code>$(&quot;p&quot;).hide()</code> ：隐藏所有<code>&lt;p&gt;</code>元素</li>
<li><code>$(&quot;p.test&quot;).hide()</code> ：隐藏所有<code>class=&quot;test&quot;</code>的<code>&lt;p&gt;</code>元素</li>
<li><code>$(&quot;#test&quot;).hide()</code> ：隐藏<code>id=&quot;test&quot;</code>的元素</li>
</ul>
<h2 id="文档就绪事件"><a href="#文档就绪事件" class="headerlink" title="文档就绪事件"></a>文档就绪事件</h2><p>为了防止文档在完全加载之前就运行<code>jQuery</code>代码，可以将所有<code>jQuery</code>函数放在一个<code>document ready</code>函数中</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line"></span><br><span class="line">   <span class="comment">// 开始写 jQuery 代码...</span></span><br><span class="line"></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<p>简洁写法：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line"></span><br><span class="line">   <span class="comment">// 开始写 jQuery 代码...</span></span><br><span class="line"></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<p>实际上JavaScript也提供了文档就绪事件函数</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;script&gt;</span><br><span class="line">    <span class="built_in">window</span>.onload = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">        <span class="comment">//在浏览器加载完整个html网页后立即执行</span></span><br><span class="line">    &#125;</span><br><span class="line">&lt;<span class="regexp">/script&gt;</span></span><br></pre></td></tr></table></figure>

<p>二者的区别在于</p>
<ul>
<li><code>jQuery</code>的入口函数是在HTML所有标签（DOM）都加载之后，就执行</li>
<li>JavaScript的<code>window.onload</code>事件是等到所有内容，包括外部图片等都加载完之后才会执行。</li>
</ul>
<h2 id="选择器"><a href="#选择器" class="headerlink" title="选择器"></a>选择器</h2><p><code>jQuery</code>选择器允许您对HTML元素组或单个元素进行操作。</p>
<p><code>jQuery</code>选择器基于元素的id、类、类型、属性、属性值等”查找”（或选择）HTML 元素。 它基于已经存在的CSS选择器，除此之外，它还有一些自定义的选择器。</p>
<p><code>jQuery</code>中所有选择器都以美元符号开头：<code>$()</code></p>
<h3 id="元素选择器"><a href="#元素选择器" class="headerlink" title="元素选择器"></a>元素选择器</h3><p>基于元素名选取元素</p>
<p>在页面选取所有<code>&lt;p&gt;</code>元素</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"p"</span>)</span><br></pre></td></tr></table></figure>

<p>示例：在用户点击按钮后所有<code>&lt;p&gt;</code>元素都隐藏</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">  $(<span class="string">"button"</span>).click(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    $(<span class="string">"p"</span>).hide();</span><br><span class="line">  &#125;);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<h3 id="id选择器"><a href="#id选择器" class="headerlink" title="id选择器"></a>id选择器</h3><p>id选择器通过HTML元素的id属性选取指定的元素。<br>页面中元素的id应该是唯一的，所以您要在页面中选取唯一的元素需要通过id选择器。</p>
<p>语法如下：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"#test"</span>)</span><br></pre></td></tr></table></figure>

<p>示例：当用户点击按钮后，有<code>id=&quot;test&quot;</code>属性的元素将被隐藏</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">  $(<span class="string">"button"</span>).click(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    $(<span class="string">"#test"</span>).hide();</span><br><span class="line">  &#125;);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<h3 id="class选择器"><a href="#class选择器" class="headerlink" title="class选择器"></a><code>class</code>选择器</h3><p><code>jQuery</code>类选择器可以通过指定的class查找元素</p>
<p>语法如下：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">".test"</span>)</span><br></pre></td></tr></table></figure>

<p>示例：用户点击按钮后所有带有<code>class=&quot;test&quot;</code>属性的元素都隐藏：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">  $(<span class="string">"button"</span>).click(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    $(<span class="string">".test"</span>).hide();</span><br><span class="line">  &#125;);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<h2 id="jQuery总结"><a href="#jQuery总结" class="headerlink" title="jQuery总结"></a><code>jQuery</code>总结</h2><h3 id="HTML元素操作"><a href="#HTML元素操作" class="headerlink" title="HTML元素操作"></a>HTML元素操作</h3><ol>
<li>创建元素</li>
</ol>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"&lt;div&gt;&lt;/div&gt;"</span>) -- 创建一个div元素，返回的是一个表示div元素的jQuery对象</span><br><span class="line">$(<span class="string">"&lt;div&gt;xxxx&lt;/div&gt;"</span>) -- 创建一个包含内容的div元素，返回的是一个表示div元素的jQuery对象</span><br></pre></td></tr></table></figure>

<ol start="2">
<li>添加子元素</li>
</ol>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$parent.append( $child ) -- 父元素调用方法添加子元素</span><br><span class="line">$(<span class="string">"body"</span>).append( <span class="string">"&lt;div&gt;我是新来的...&lt;/div&gt;"</span> ); -- 往body元素内部追加一个div子元素</span><br></pre></td></tr></table></figure>

<ol start="3">
<li>删除元素</li>
</ol>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"div"</span>).remove() -- 删除所有的div元素</span><br><span class="line"></span><br><span class="line">JS删除所有div元素：</span><br><span class="line"><span class="comment">//获取所有的div元素(返回的是所有div组成的数组)</span></span><br><span class="line"><span class="keyword">var</span> divArr = <span class="built_in">document</span>.getElementsByTagName(<span class="string">"div"</span>); <span class="comment">//div数组</span></span><br><span class="line"><span class="comment">//遍历div数组,依次删除每一个div元素</span></span><br><span class="line"><span class="keyword">var</span> len = divArr.length;</span><br><span class="line"><span class="keyword">for</span>(<span class="keyword">var</span> i=<span class="number">0</span>;i&lt;len;i++)&#123;</span><br><span class="line">    <span class="comment">//通过当前元素的父元素删除当前元素(始终删除第一个)</span></span><br><span class="line">    divArr[<span class="number">0</span>].parentNode.removeChild( divArr[<span class="number">0</span>] );</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ol start="4">
<li>替换元素</li>
</ol>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"div"</span>).replaceWith(<span class="string">"&lt;p&gt;我是来替换的…&lt;/p&gt;"</span>)</span><br></pre></td></tr></table></figure>

<h3 id="HTML元素内容和值的操作"><a href="#HTML元素内容和值的操作" class="headerlink" title="HTML元素内容和值的操作"></a>HTML元素内容和值的操作</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;div&gt;</span><br><span class="line">    <span class="comment">// 这是一个div11元素</span></span><br><span class="line">    &lt;span&gt;这是一个span元素&lt;<span class="regexp">/span&gt;</span></span><br><span class="line"><span class="regexp">   /</span><span class="regexp">/ 这是一个div1111元素</span></span><br><span class="line"><span class="regexp">&lt;/</span>div&gt;</span><br></pre></td></tr></table></figure>

<ol>
<li><code>html()</code>函数（类似于JavaScript的<code>innerHTML</code>属性）</li>
</ol>
<p>用于获取或设置元素内容，比如为div、span、p、好<br>、table、tr、td等元素设置内容</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"div"</span>).html() -- 获取所有div中的第一个div的内容</span><br><span class="line">$(<span class="string">"div"</span>).html(<span class="string">"xxxx"</span>) -- 为所有div设置内容</span><br></pre></td></tr></table></figure>

<ol start="2">
<li><code>text()</code>函数 (类似于js中的<code>innerText</code>属性，<code>innerText</code>在部分浏览器中不兼容)</li>
</ol>
<p>用于获取或设置元素的文本内容</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"div"</span>).text() -- 获取所有div中的所有文本内容</span><br><span class="line">$(<span class="string">"div"</span>).text(<span class="string">"xxxx"</span>) -- 为所有div设置文本内容</span><br></pre></td></tr></table></figure>

<ol start="3">
<li><code>val()函数</code> (类似于js中的<code>value</code>属性)</li>
</ol>
<p>获取或设置表单项元素的value值(input/select/option/textarea)</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">"input"</span>).val() -- 获取所有input元素中的第一个input元素的value值</span><br><span class="line">$(<span class="string">"input"</span>).val(值) -- 为所有的input元素设置value值</span><br></pre></td></tr></table></figure>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/05/13/Java%E6%97%A5%E6%8B%B1%E4%B8%80%E5%8D%92-day16/" rel="prev" title="Java日拱一卒-day16">
      <i class="fa fa-chevron-left"></i> Java日拱一卒-day16
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/05/15/Java%E6%97%A5%E6%8B%B1%E4%B8%80%E5%8D%92-day18/" rel="next" title="Java日拱一卒-day18">
      Java日拱一卒-day18 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery引入"><span class="nav-number">1.</span> <span class="nav-text">jQuery引入</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery语法"><span class="nav-number">2.</span> <span class="nav-text">jQuery语法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#文档就绪事件"><span class="nav-number">3.</span> <span class="nav-text">文档就绪事件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#选择器"><span class="nav-number">4.</span> <span class="nav-text">选择器</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#元素选择器"><span class="nav-number">4.1.</span> <span class="nav-text">元素选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#id选择器"><span class="nav-number">4.2.</span> <span class="nav-text">id选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#class选择器"><span class="nav-number">4.3.</span> <span class="nav-text">class选择器</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery总结"><span class="nav-number">5.</span> <span class="nav-text">jQuery总结</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML元素操作"><span class="nav-number">5.1.</span> <span class="nav-text">HTML元素操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML元素内容和值的操作"><span class="nav-number">5.2.</span> <span class="nav-text">HTML元素内容和值的操作</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="文予"
      src="/uploads/wenyu.png">
  <p class="site-author-name" itemprop="name">文予</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">29</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">文予</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>


        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>











<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'forest',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  

</body>
</html>
